package com.vegetable.modules.entity.allocation;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.vegetable.common.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 分配回款明细表
 * </p>
 *
 * @author Qoder
 * @since 2025-10-08
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("allocation_collection_detail")
@ApiModel(value="AllocationCollectionDetail对象", description="分配回款明细表")
public class AllocationCollectionDetail extends BaseEntity {

    @ApiModelProperty(value = "主表ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long mainId;

    @ApiModelProperty(value = "销售出库单ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long salesOutId;

    @ApiModelProperty(value = "销售出库单号")
    private String salesOutDocNo;

    @ApiModelProperty(value = "分配金额")
    private BigDecimal allocatedAmount;

    @ApiModelProperty(value = "提成-对外")
    private BigDecimal commissionOut;

    @ApiModelProperty(value = "扣款金额")
    private BigDecimal deductionAmount;

    @ApiModelProperty(value = "扣款原因")
    private String deductionReason;

    @ApiModelProperty(value = "扣款处理状态 0未处理，1已处理")
    private Integer deductionHandleStatus = 0;

    @ApiModelProperty(value = "扣款处理意见")
    private String deductionHandleOpinion;

    @ApiModelProperty(value = "企业承担金额")
    private BigDecimal companyDeductionAmount;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
}